﻿using HZU.ZP.Data.Impl;
using HZU.ZP.Data.Interfaces;
using HZU.ZP.Domain.IService;
using HZU.ZP.Domain.Model;
using HZU.ZP.Domain.ServiceImpl.Mappers;
using System;
using System.Collections.Generic;
using System.Text;


namespace HZU.ZP.Domain.ServiceImpl.PCSvc
{
    public class CompayPictureService:ICompayPictureService
    {
        private CompayPictureMapper _mapper = new CompayPictureMapper();
        private ICompayPictureDao _sqlData;
        public CompayPictureService(ICompayPictureDao sqlData)
        {
            _sqlData = sqlData;
        }

        public bool Add(CompayPicture compayPicture)
        {
            var compayPictureDao = _mapper.MapToDao(compayPicture);
            _sqlData.Add(compayPictureDao);
            return true;
        }

        public bool Delete(int id)
        {
            _sqlData.Delete(id);
            return true;
        }

        public IList<CompayPicture> GetByCompanyId(int companyId)
        {
            return _mapper.MapToDomainList(_sqlData.GetByCompanyId(companyId));
        }
    }
}
